package Chinese.Education.Identify.controller;

import Chinese.Education.Identify.vo.JSONUser;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/te")
public class TestController {
    @RequestMapping("/test")
    public String test(){
        return "test";
    }

    @RequestMapping("/param00")
    public String param00(String name){
        return "param00:";
    }

    @RequestMapping("/param01")
    public String param01(String name, int age){
        return "param01:";
    }

    @RequestMapping(value = "/param02",method = RequestMethod.POST)
    public String param02(@RequestParam String username, @RequestParam int password){
        System.out.println("username=" + username + " password=" + password);
        return "param02:";
    }

    @RequestMapping(value = "/json", method = RequestMethod.POST)
    public String JSON(@RequestBody JSONUser j){

       System.out.println("JSONUser.getUsername()=" + j.getUsername());
       return "JSON:JSONUser.getUsername()=" + j.getUsername();
    }
}
